<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('卡单状态配置列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <!--							<li>-->
                        <!--								会员ID：<input disabled type="text" name="settingId" th:value="${userId}"/>-->
                        <!--							</li>-->
                        <li>
                            状态：
                            <select name="payStatus">
                                <option value=""></option>
                                <option value="已完成">已完成</option>
                                <option value="未完成">未完成</option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-success btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()"
               shiro:hasPermission="channel:businessPauseOrderSetting:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-success btn-edit disabled" onclick="$.operate.edit()"
               shiro:hasPermission="channel:businessPauseOrderSetting:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-success btn-del btn-del disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="channel:businessPauseOrderSetting:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var userId = [[${userId}]];
    var editFlag = [[${@permission.hasPermi('channel:businessPauseOrderSetting:edit')}]];
    var removeFlag = [[${@permission.hasPermi('channel:businessPauseOrderSetting:remove')}]];
    var prefix = ctx + "channel/businessPauseOrderSetting";

    $(function () {
        var options = {
            url: prefix + "/list/" + userId,
            createUrl: prefix + "/add/" + userId,
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "卡单状态配置",
            sortName: "updateTime",
            sortOrder: "desc",
            columns: [{
                checkbox: true
            },
                {
                    field: 'userId',
                    title: '会员id',
                    visible: true
                },
                {
                    field: 'orderPrice',
                    title: '卡单金额',
                    sortable: true
                },
                {
                    field: 'orderNum',
                    title: '卡第几单',
                    sortable: true
                },
                {
                    field: 'payStatus',
                    title: '状态',
                    sortable: true
                },
                {
                    field: 'orderTimes',
                    title: '倍数',
                    sortable: true
                },
                {
                    field: 'updateTime',
                    title: '更新时间',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.settingId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.settingId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>